package ru.study.thinkin.chapter10.gui;

import java.util.Random;

public  abstract class Event {
	protected long id = new Random().nextInt(100);
	private long eventTime;
	protected final long delayTime;
		
	
	public Event(long delayTime) {
		this.delayTime = delayTime;
		start();
	}	
	public void start() {
		eventTime = System.nanoTime()+delayTime;
	}
	
	public boolean ready() {
		return System.nanoTime() >= eventTime;
	}
	
	public abstract void action();
}
